package com.cy.service;

import com.cy.dao.GoodsDAO;
import com.cy.domain.Goods;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Slf4j//log log自动创建
        // 相当于 private static final Logger log = LoggerFactory.getLogger(GoodsServiceImp.class)
@Service
public class GoodsServiceImp implements GoodsService {
    @Autowired
    private GoodsDAO goodsDAO;



    @Override
    public List<Goods> findAll() {
        return goodsDAO.findAll();
    }

    @Override
    public Integer deleteById(Integer id) {
        return goodsDAO.deleteById(id);
    }

    @Override
    public Integer goodsInsert(Goods goods) {
        return  goodsDAO.goodsInsert(goods);
    }

    @Override
    public Goods selectOne(Integer id) {
        return goodsDAO.selectOne(id);
    }

    @Override
    public Integer goodsUpdate(Goods goods) {
        return goodsDAO.goodsUpdate(goods);
    }


}
